home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir42 / ezhelp14.zip / SPAWNHLP.C < prev    next >
C/C++ Source or Header  |  1991-02-01  |  1KB  |  60 lines

  1. /* ======================================================================== */
  2. /* FILE: SPAWNHLP.C */
  3.  
  4. #include <process.h>
  5. #include <stdio.h>
  6. #include <stdlib.h>
  7.  
  8. /* ======================================================================== */
  9. /* FUNCTION: SpawnHelp
  10. **
  11. ** This function can be linked into C programs and called to
  12. ** spawn the EZhelp Reference system.
  13. **
  14. ** Parameters:  iMenu - Menu to start EZhelp
  15. **              iHelp - Topic to jump directly into
  16. **                      (or 0 to show the menu)
  17. **              fAuto - TRUE if automatic window sizing
  18. **                      should be performed, FALSE otherwise
  19. **              fDisp - TRUE if errors should be displayed,
  20. **                      FALSE otherwise
  21. **              fLoc  - help window anchor (1 - 9)
  22. **
  23. **
  24. **
  25. ** Returns: The result of the spawnv() call.
  26. **
  27. */
  28.  
  29. /* int
  30. SpawnHelp(int iMenu, int iHelp, int Auto,
  31.           int fDisp, int fLoc) { */
  32. int
  33. SpawnHelp(int iMenu, int iHelp) {
  34.  
  35.   int iSize;
  36.   char *pArg;
  37.   char *path = "EZHELP.EXE";
  38.   char *args[] = { "EZHELP.EXE",
  39.                    "EZSETUP.TXT",
  40.                    "-M   ",
  41.                    "-J   ",
  42.                    0 };
  43.  
  44.   pArg = args[2];
  45.   pArg += 2;
  46.   iSize = iMenu < 10 ? 1 : 2;
  47.   sprintf(pArg,"%*d", iSize, iMenu);
  48.  
  49.   pArg = args[3];
  50.   pArg += 2;
  51.   iSize = iHelp < 10 ? 1 : 2;
  52.   sprintf(pArg,"%*d", iSize, iHelp);
  53.  
  54.   return(spawnvp(P_WAIT, path, args));
  55.  
  56. }
  57.  
  58.  
  59.  
  60.